from user import User

class Student(User):
    def __init__(self, name, age, gender, id):
        super().__init__(name, age, gender, id)
        self.course = []

    def show_info(self):
        super().show_info()
        print("该学生的选课信息：")
        if self.course == []:
            print("未选课")
        else:
            for course in self.course:
                print(course.name)

    def add_course(self, course):
        self.course.append(course)